<head>
	<script type="text/javascript" src="{{ STATIC_URL }}js/users.js"></script>
	<title>S.E.C.-Użytkownicy</title>
</head>

<div id="show_user_box">
	<div class="navbar ">
		<div class="navbar-inner">
			<input id="filter" type="text" class="search-query" placeholder="Wyszukaj...">
			<div class="btn-group">
				<button class="btn btn-primary" onclick="showAddModal();">
					Dodaj
				</button>
				<button class="btn" onclick="showEditModal();">
					Edytuj
				</button>
				<button class="btn btn btn-danger" onclick="deleteUser();">
					Usuń
				</button>
				<button class="btn" onclick="reloadUser();">
					<img src="{{ STATIC_URL }}img/reload.png" style="width: 18px;">
				</button>
			</div>
			<br />
			<form>
				<table id="users_table" class="table table-striped">
					<thead>
						<tr>
							<th></th>
							<th>#
							</th>
							<th>Name
							</th>
							<th>Lastname
							</th>
							<th>Username
							</th>
							<th>Address
							</th>
							<th>Card number
							</th>
							<th>Phnone number
							</th>
							<th>Privilage
							</th>
						</tr>
					</thead>
					<tbody id="users_table_body">
					</tbody>
				</table>
			</form>
		</div>
	</div>
	<div id="add_user_modal" class="modal hide fade">
		<div class="modal-header">
			<button class="close" data-dismiss="modal" aria-hidden="true">
				&times;
			</button>
			<h3 id="user_modal_title">Add User
				<button class="btn btn btn-warning" onclick="resetForm();">
					Reset
				</button>
			</h3>
		</div>
		<div class="modal-body">
			{{ form.as_p }}
		</div>
		<div class="modal-footer">
			<div id="alert_area">
			</div>
			<br />
			<a onclick="$('#add_user_modal').modal('hide');" class="btn">Anuluj</a>
			<button class="btn btn-primary" id="submit_add" onclick="">
				Zatwierdź
			</button>
		</div>
	</div>
	<div id="delete_modal" class="modal hide fade">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
				&times;
			</button>
			<h3>Usuwanie</h3>
		</div>
		<div class="modal-body">
			Czy chcesz usunąć wybranego użytkownika?
		</div>
		<div class="modal-footer">
			<div id="alert_area">
			</div>
			<br />
			<a onclick="$('#add_user_modal').modal('hide');" class="btn">Nie</a>
			<button class="btn btn-danger" id="submit_add" onclick=" delUser();$('#delete_modal').modal('hide');">
				Tak
			</button>
		</div>
	</div>
</div>
